#pragma once

#include <iostream>
#include <vector>
#include <string>

#define SEP 'X'
#define SEP_LEN sizeof(SEP)

//XXX
void PackageSplit(std::string &inbuffer, std::vector<std::string> *result)
{
    while(true)
    {
        std::size_t pos = inbuffer.find(SEP);
        if(pos == std::string::npos) break;
        result->push_back(inbuffer.substr(0, pos));
        inbuffer.erase(0, pos + SEP_LEN);
    }
}

